<?php

header('Content-type: application/json');

if (isset($_REQUEST['username'])) {
	if ($db->fetchOne("SELECT id FROM cms_users WHERE username=? AND site_id=?", array($_REQUEST['username'], $site['id']))) {
		echo json_encode(true);
	} else {
		echo json_encode(false);
	}
}
elseif (isset($_REQUEST['email'])) {
	if ($db->fetchOne("SELECT id FROM cms_users WHERE email=? AND site_id=?", array($_REQUEST['email'], $site['id']))) {
		echo json_encode(true);
	} else {
		echo json_encode(false);
	}
}
else {
	echo json_encode(false);
}